import { uploadPic } from './api'

export function Upload (file, type, callback) {
  var formData = new FormData()
  formData.append('file', file)
  formData.append('pathName', type)
  uploadPic(formData).then(
    data => {
      callback(`/upload/${data.path}`)
    }
  ).catch(
    msg => {
      console.log('错误')
    }
  )
}
